<template>
  <contents
    :heightInclude="['tabBar']"
    backgroundColor="#fff"
    class="login_page"
  >
    <UserFormBackground />
    <UserFormLogin :agreement="checked" />
    <view style="height: 120rpx"></view>
    <view class="page_footer">
      <!-- <view class="text_item">
				© 2019 Druglots 今朝万象
				<text style="color: #213768;">粤ICP备18108298号</text>
			</view> -->
      <view class="text_item">
        <u-checkbox
          v-model="checked"
					shape="circle"
					size="25"
          >{{ $t('locales.loginAgreement') }}</u-checkbox
        >
        
        <text
          style="color: #213768"
          @click="navSwitch('/pages/user/login/agreement')"
          >《{{ $t('locales.userAgreement') }}》</text
        >
        {{ $t('locales.or') }}
        <text
          style="color: #213768"
          @click="navSwitch('/pages/user/login/agreement')"
          >《{{ $t('locales.privacyAgreement') }}》</text
        >
      </view>
      <!-- <view class="text_item">Version：{{ version }}</view> -->
    </view>
  </contents>
</template>

<script>
import UserFormBackground from '@/components/userFormBackground'
import UserFormLogin from '@/components/userFormLogin'
import { versionNumber } from '@/config'
export default {
  components: {
    UserFormBackground,
    UserFormLogin
  },
  data() {
    return {
      version: versionNumber,
      weCode: null,
			checked: true
    }
  },
  onLoad(opt) {
    if (opt.code) {
      // 判断是否有code,有的话直接登录
      this.$store.dispatch('weChatLogin', {
        code: opt.code
      })
    }
  },
  methods: {
    navSwitch(url) {
      uni.navigateTo({
        url
      })
    }
  }
}
</script>

<style lang="scss">
.login_page {
  .page_footer {
    width: 100%;
    background-color: #fff;
    color: #777777;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 18rpx;
    padding: 30rpx 0;
    .text_item {
			display: flex;
			align-items: center;
      font-size: 20rpx;
    }
		/deep/ .u-checkbox__label {
			font-size: 20rpx;
			margin-right: 0;
		}
  }
}
</style>
